var Click2TabHistoryPanel = 
{
    init : function ()
    {
        eval("openURL = " +
             openURL.toString().replace('openURLIn(whereToOpenLink(aEvent));',
                                        'openURLIn(whereToOpenLinkTabmix(aEvent, prefStringTMHistory));'));

        eval("buildContextMenu ="+buildContextMenu.toString().replace(
          'openItem.hidden = false;',
          'var where = TMP_whereToOpen("extensions.tabmix.opentabfor.history"); \
           var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);\
           var singlemode = prefService.getBoolPref("extensions.tabmix.singleWindow");\
           openItemInNewWindow.hidden = singlemode; \
           openItem.setAttribute("default", !where.inNew);\
           openItem.hidden = where.lock;\
           openItemInNewTab.setAttribute("default", where.inNew);'
        ));

    },

    deinit : function ()
    {
        eval("openURL = " +
             openURL.toString().replace('openURLIn(whereToOpenLinkTabmix(aEvent, prefStringTMHistory));',
                                        'openURLIn(whereToOpenLink(aEvent));'));
    }

}